<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:a4j="http://richfaces.org/a4j"
	xmlns:rich="http://richfaces.org/rich"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Globallogic vacation planner 1.0</title>
	<link rel="stylesheet" type="text/css" href="css/container.css" />
	<link rel="stylesheet" type="text/css" href="css/createProject.css" />
	<link rel="stylesheet" type="text/css" href="css/userPage.css" />
</h:head>
<h:body bgcolor="silver">
	<div class="container">
		<center>
			<h2>Edit project page</h2>
		</center>
		<div class="poster">
			<a> <img src="images/defaultUser.png" width="160px"
				height="160px" />
			</a>
			<p>
				<a href="editProfile.xhtml">edit profile</a>
			</p>
		</div>
		<div class="about">
			<font color="blue">
				<p>Name: #{userBean.userName}</p>
				<p>Surname: #{userBean.surname}</p>
				<p>Email: #{userBean.email}</p>
			</font>

		</div>
		<div class="links">

			<p align="left">
				<h:form>
					<a href="userPage.xhtml">Home___|___</a>
					<a href="vacation.xhtml">Vacations___|___</a>
					<a href="projects.xhtml">Projects___|___</a>
					<h:commandLink value="Log out" action="#{userBean.logout}" />
				</h:form>
			</p>
		</div>
		<center>
			<div class="table">
				<h:form>
					<rich:panel header="Creation form">
						<h:panelGrid columns="4">
							<h:outputText value="Project Name" />
							<h:inputText required="true"
								value="#{projectBean.edtiProjectDto.name}" id="name"
								label="Project Name"
								requiredMessage="Project Name must be not empty"
								validatorMessage="Project name must be for 3 to 15 characters length">
								<f:validateLength minimum="3" maximum="15" />
								<f:validateRequired />
								<rich:validator />
							</h:inputText>
							<rich:message for="name" ajaxRendered="true" />
							<br />
							<br />
							<h:outputText value="Project description" />
							<h:inputTextarea rows="5" required="true"
								value="#{projectBean.edtiProjectDto.description}"
								id="description" label="Project description"
								requiredMessage="Project Name must be not empty"
								validatorMessage="Project name must be for 3 to 45 characters length">
								<f:validateLength minimum="3" maximum="45" />
								<f:validateRequired />
								<rich:validator />
							</h:inputTextarea>
							<rich:message for="description" ajaxRendered="true" />
							<br />
							<rich:panel style="width:220px;">
								<f:facet name="header">
									<h:outputText value="State of project"></h:outputText>
								</f:facet>
								<rich:select value="#{projectBean.edtiProjectDto.state}">
									<f:selectItem itemValue="Open" itemLabel="Open" />
									<f:selectItem itemValue="In Progress" itemLabel="In Progress" />
									<f:selectItem itemValue="Closed" itemLabel="Closed" />
								</rich:select>
							</rich:panel>
						</h:panelGrid>
						<rich:panel style="width:560px;">
							<f:facet name="header">
								<h:outputText value="Simple pick list"></h:outputText>
							</f:facet>
							<rich:pickList
								value="#{projectBean.edtiProjectDto.userMembersList}"
								sourceCaption="Users list" targetCaption="Selected users"
								listWidth="165px" listHeight="100px" orderable="true">
								<f:selectItems value="#{projectBean.users}" var="user"
									itemValue="#{user}" itemLabel="#{user.login}" />
								<f:converter converterId="userListConverter" />
							</rich:pickList>
						</rich:panel>
					</rich:panel>
					<h:panelGrid columns="2">
						<a4j:commandButton action="#{projectBean.editUserProject}"
							value="Edit project" style="height: 20px; width: 100px" />
					</h:panelGrid>
				</h:form>
			</div>
		</center>
	</div>
</h:body>
</html>
